package kr.hkit.javaproject.dd1.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;

import kr.hkit.javaproject.dd1.dto.Department;

public class DepartmentDAO implements DaoInterface<Department> {
	private Connection connection;
	private PreparedStatement pstmt;
	
	public DepartmentDAO() {}

	public DepartmentDAO(Connection connection) {
		this.connection = connection;
	}

	@Override
	public void insertItem(Department item) throws SQLException {
		String sql = "insert into department values(?, ?, ?)";
		pstmt = connection.prepareStatement(sql);
		pstmt.setInt(1, item.getDeptNo());
		pstmt.setString(2, item.getDeptName());
		pstmt.setInt(3, item.getFloor());
		System.out.println(pstmt);
	}

	@Override
	public void deleteItemByNo(Department item) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void updateItemByNo(Department item) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Department searchItems(Department item) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ArrayList<Department> listItems() {
		// TODO Auto-generated method stub
		return null;
	}
	
}
